﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace WorkStation.Frameworks.Core.Data
{
    /// <summary>
    /// * 通用查询规格书接口
    /// </summary>
    /// <typeparam name="T">参选数据类型</typeparam>
    public interface ISpecification<T>
    {
        /// <summary>
        /// * 是否符合规格
        /// </summary>
        /// <param name="candidate">参选数据</param>
        /// <returns></returns>
        bool IsSatisfiedBy(T candidate);

        /// <summary>
        /// * 表达式
        /// </summary>
        Expression<Func<T, bool>> Expression { get; set; }
    }
}
